#!/bin/bash
cur=$(dirname $(readlink -f "$0"))
cd $cur

mkdir -p blobs data

function genOne(){
  local type=$1; local cnt=$2; local repeat=$3
  for ((i=0; i<$repeat; i++)) do
    echo -e "\ntype=$type, cnt=$cnt, repeat: $((i+1))/$repeat"
    m1=$((1024*1024)); rq=$(date +%Y%m%d_%H%M%S_%3N); #echo "m1: $m1"
    suffix=bin; test "data" == "$type" && suffix=dat
    dd if=/dev/urandom of=$type/file_$rq.$suffix bs=$m1 count=$cnt
    
    git add -A ./$type/ 
    git commit -m "./$type"
  done
}

genOne data 1 1
genOne blobs 1 1
# genOne data 100 5
# genOne blobs 500 2
git push
